package io.renren.modules.lucky.controller;


import com.alibaba.fastjson2.JSON;
import io.renren.common.utils.Result;
import io.renren.modules.lucky.dto.background.AddUserReq;
import io.renren.modules.lucky.dto.background.ReportReqDto;
import io.renren.modules.lucky.service.LuckyBaseService;
import io.renren.modules.lucky.task.LuckyReportTask;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/test")
@Api(tags="招财猫管理员接口")
@AllArgsConstructor
public class TaskTest {
    private static final Logger logger = org.slf4j.LoggerFactory.getLogger(TaskTest.class);

    private final LuckyReportTask luckyReportTask;
    private final LuckyBaseService luckyBaseService;

    @PostMapping("/test")
    @ApiOperation("添加合作商信息")
    public Result report(@RequestBody ReportReqDto reportReq) {
        UserDetail user = new UserDetail();
        user.setId(1876884943376994306L);
        logger.info("收益报表查询: {}", JSON.toJSONString(reportReq));
        return luckyBaseService.reportQuery(reportReq, user);
        //luckyReportTask.saveReport();
    }
}
